import {
  Entity,
  PrimaryGeneratedColumn,
  Tree,
  TreeChildren,
  TreeParent,
} from 'typeorm';

@Entity('tb_sys_resource', {
  comment: '系统资源表',
})
@Tree('closure-table')
export class SysResource {
  @PrimaryGeneratedColumn('increment', { comment: '自增主键', unsigned: true })
  id: number;

  @TreeParent()
  parent: SysResource;

  @TreeChildren()
  children: SysResource[];
}
